package com.wangzh.collection;

import java.util.ArrayDeque;
import java.util.Deque;

public class DequeDemo {

    public static void main(String[] args) {
        Deque<String> deque = new ArrayDeque<>(3);

        deque.push("a");
        deque.push("b");
        deque.push("c");
        deque.push("d");


        System.out.println(deque);

        for (int i = 0; i < 4; i++) {
            System.out.println(deque.pop());
        }

    }
}
